package com.zy.web.demo.duoxiancheng.demo13;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/13 14:36
 */
public class MyThreadA13 {


    Object object1 = new Object();

     public void methodA(){
         synchronized (object1){
             System.out.println("methodA begin");
             boolean zy = true;
             while (zy){

             }
             System.out.println("method end");
         }
    }

    Object object2 = new Object();

     public void methodB(){
         synchronized (object2){
             System.out.println("method begin");
             System.out.println("method end");
         }
    }

}
